#pragma once
#include "Anim.h"

class FreezingArea;

class Player;

extern Player gMale;
extern Player gFemale;

const float VIEW_SIZE = 100.0f;

class Player
{
public:
	Player();

	void LoadAnims();
	void Draw(sf::RenderWindow& window);
	void Step();

	sf::Vector2f GetSize();

	void Freeze(FreezingArea* area);

	sf::Vector2f pos;
	sf::Vector2f vel;

	FreezingArea *mFreezingArea;

private:
	bool IsFemale() { return this == &gFemale; }
	bool CollideWithTiles();
	bool CollideWithHalfs(int x, int y);
	bool CollideWithLadder();
	void Jump();
	bool mCanJump;

	Anim* idleAnim;
	Anim* walkAnim;
	Anim* jumpAnim;
	Anim* fallAnim;
	Anim* ladderAnim;

	Anim* activeAnim;
	Anim* lastActiveAnim;
	float animTimer;

	static sf::SoundBuffer* jumpBuffer;
	static sf::Sound* jumpSound;
};